> Forest of True Sight > Questions & Answers Reload this Page Spear of Lightning Oddities
Reply
Old Mar 06, 2007, 11:25 AM // 11:25   #1
Academy Page
 
Join Date: Oct 2006
Advertisement

Disable Ads
Default Spear of Lightning Oddities

In an effort to understand how damage works a bit better I've been writing my own little damage calculators and testing them all to make sure they're correct and for the most part they have been. Recently however I added in support for armour penetration and decided to test how it worked with Spear of Lightning which has 25% armour penetration.

Running the calculations I determined that with 16 Spear Mastery, a 15^50 customised spear without a sundering mod and 25% armour penetration I should crit for 78 damage, which adding in the extra damage from Spear of Lightning (+21) gives me a total of 99 damage to expect. What I saw however was 101 on a crit with Spear of Lightning giving me 2 damage I can't account for.

I immediately figured that the problem was in my calculations so I decided to test it out on higher armour targets and found contrary to my expectations that my calculations for 80 and 100 armour targets were exactly correct. Feeling a bit puzzled and wondering if my calculations were somehow off only on 60 armour targets (and below perhaps) I tested out Penetrating Blow on a 60 armour target, but again my calculations were correct.

So, my question is, is there some oddity with Spear of Lightning or am I off somehow in this one case with my critical damage calculations?
TLLOTS is offline   Reply With Quote
Old Mar 06, 2007, 01:20 PM // 13:20   #2
Banned
 
Yanman.be's Avatar
 
Join Date: Dec 2005
Location: Belgium
Guild: [ROSE]
Profession: A/
Default

The 60 al target doesn't like elemental damage?

+1 spear mastery?


Can you post your calculation works/programs?
Yanman.be is offline   Reply With Quote
Old Mar 07, 2007, 10:33 AM // 10:33   #3
Academy Page
 
Join Date: Oct 2006
Default

Quote:
Originally Posted by Yanman.be
The 60 al target doesn't like elemental damage?

+1 spear mastery?


Can you post your calculation works/programs?
Firstly, thanks for the response, I wasn't sure I'd get one for something like this

Regarding my spear, the only mods on it are a +15^50, +20% customization bonus, +30 health and +33% longer deep wound duration. All of that I factored into my calculations and all of that has proven to be correct in all attacks I've made involving armour penetration save for this one against a 60 armour target with Spear of Lightning.

Regarding my code, it's all included below. You'll have to excuse its presentation, it wasn't exactly intended for public consumption.

Code:
//The following is used in the calculation of critical hits
var root_two = Math.sqrt(2);

function begin()
{
	//Collect all form data and set variables to their starting values
	var base_min_damage = parseInt(document.getElementById('min_dmg').value);
	var base_max_damage = parseInt(document.getElementById('max_dmg').value);
	var attack_speed = parseFloat(document.getElementById('attack_speed').value);
	var attribute_level = parseInt(document.getElementById('attribute_level').value);
	var armour_level = parseInt(document.getElementById('armour_level').value);
	var armour_penetration = parseInt(document.getElementById('armour_penetration').value);
	var customised = document.getElementById('customised').checked;
	var plus_damage_mod = document.getElementById('plus_damage_mod').checked;
	var damage_mod = 1;
	
	//Determines if any additional mods are on the weapon such as being customised or 15^50 mod 
	if (customised)
	{
		damage_mod = 1.20;
	}
	if (plus_damage_mod)
	{
		damage_mod *= 1.15;
	}
	//Adjusts the characters armour level for armour penetration
	armour_level = armour_level * (1 - armour_penetration / 100);
	
	
	var actual_min_damage = calculate_damage(base_min_damage, attribute_level, damage_mod, armour_level);
	var actual_max_damage = calculate_damage(base_max_damage, attribute_level, damage_mod, armour_level);
	var critical_damage = calculate_critical(base_max_damage, attribute_level, damage_mod, armour_level);
	var average_damage_per_hit = calculate_average_damage(actual_min_damage, actual_max_damage, critical_damage, attribute_level);
	var damage_per_second = calculate_damage_per_second(average_damage_per_hit, attack_speed);
	
	display_results(actual_min_damage, actual_max_damage, critical_damage, average_damage_per_hit, damage_per_second);
}

function calculate_damage(weapon_damage, attribute_level, damage_mod, armour_level)
{
	var damage = 0;
	//Determine damage against 60 armour target
	if (attribute_level < 13)
	{
		damage = weapon_damage * damage_mod * Math.pow(2, ((5 * attribute_level - 60) / 40));
	}
	else
	{
		damage = weapon_damage * damage_mod * Math.pow(2, ((2 * attribute_level - 24) / 40));
	}
	//adjust for armour
	damage = damage * Math.pow(2,(60 - armour_level)/40);
	return damage;
}

//Calculates the damage for a critical hit with the given weapon
function calculate_critical(base_max_damage, attribute_level, damage_mod, armour_level)
{
	return calculate_damage(base_max_damage, attribute_level, damage_mod, armour_level) * root_two;
}

//Calcualates the damage per second with the given weapon
function calculate_damage_per_second(average_damage_per_hit, attack_rate)
{
	return average_damage_per_hit / attack_rate;
}

//Calculates the average daamge the weapon will deal, factoring in critical hits
function calculate_average_damage(actual_min_damage, actual_max_damage, critical_damage, attribute_level)
{
	var average_damage = ((actual_min_damage + actual_max_damage) / 2);
	average_damage = (critical_damage - average_damage) * crit_chance(attribute_level) + average_damage;
	return average_damage;
}

//Determines the characters chance of getting a critical hit
function crit_chance(attribute_level)
{
	return 0.01 + (0.0144 * attribute_level);
}

//Displays the results of the test
function display_results(min_damage, max_damage, crit_damage, average_damage_per_hit, damage_per_second)
{
	var display = document.getElementById('output');
	display.innerHTML = "Minimum Damage: " + round_damage(min_damage) + "<br />\n";
	display.innerHTML += "Maximum Damage: " + round_damage(max_damage) + "<br />\n";
	display.innerHTML += "Critical Damage: " + round_damage(crit_damage) + "<br />\n";
	display.innerHTML += "Average Damage Per Hit: " + round_damage(average_damage_per_hit) + "<br />\n";
	display.innerHTML += "Damage Per Second: " + round_damage(damage_per_second) + "<br />\n";
	display.innerHTML += "Critical Hit Chance: " + crit_chance(parseInt(document.getElementById('attribute_level').value)) + "<br />\n";
}

//This function rounds the damage for the attack down to something easier to read. Current implementations
//simply chop off all but two numbers after the decimal place and there have been some precision concerns, as such
//no rounding is presently done. This function will be fixed at a later date.
function round_damage(damage)
{
	//damage = damage.toString();
	//return parseFloat(damage.substr(0, damage.indexOf('.') + 3));
	return damage;
}
The following is the html that accompanies it:

Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script type="text/javascript" src="javascript/script.js">
</script>
</head>

<body>
	<form>
		<table>
			<tr>
				<td>Minimum Damage:</td>
				<td><input type="text" id="min_dmg" /></td>
			</tr>
			<tr>
				<td>Maximum Damage:</td>
				<td><input type="text" id="max_dmg" /></td>
			</tr>
			<tr>
				<td>Attack Speed:</td>
				<td><input type="text" id="attack_speed" /></td>
			</tr>
			<tr>
				<td>Attribute Level:</td>
				<td><input type="text" id="attribute_level" /></td>
			</tr>
			<tr>
				<td>Armour Level:</td>
				<td><input type="text" id="armour_level" value="60" /></td>
			</tr>
			<tr>
				<td>Armour Penetration:</td>
				<td><input type="text" id="armour_penetration" value="0" /></td>
			</tr>
			<tr>
				<td>Customised:</td><td><input type="checkbox" id="customised" /></td>
			</tr>
			<tr>
				<td>+15^50:</td><td><input type="checkbox" id="plus_damage_mod" /></td>
			</tr>
			<tr>
				<td colspan="2"><input type="submit" value="Begin Analysis" onclick="begin(); return false;" /></td>
			</tr>
		</table>
	</form>
	<div id="output">
	</div>
</body>
</html>
TLLOTS is offline   Reply With Quote
Old Mar 07, 2007, 10:49 AM // 10:49   #4
Wilds Pathfinder
 
Marth Reynolds's Avatar
 
Join Date: Jan 2006
Location: The Netherlands
Guild: The Lore Enforcers
Profession: Me/A
Default

The straw dolls have higher armor vs lightning dmg..

noticed it on my war, my lightning dmg axe did way less dmg then my physcial dmg one...

can't recall how much atm.
Marth Reynolds is offline   Reply With Quote
Old Mar 07, 2007, 09:23 PM // 21:23   #5
Academy Page
 
Join Date: Oct 2006
Default

Quote:
Originally Posted by Marth Reynolds
The straw dolls have higher armor vs lightning dmg..

noticed it on my war, my lightning dmg axe did way less dmg then my physcial dmg one...

can't recall how much atm.
Unfortunately this doesn't appear to be correct. I've tested it out with a lightning spear and all damage was what it should be. Also if they had more armour against lightning damage then I'd actually do less damage than I predicted, not more.
TLLOTS is offline   Reply With Quote
Old Mar 07, 2007, 11:43 PM // 23:43   #6
Academy Page
 
Join Date: Dec 2006
Default

Looks like you based your calculations on Ensign's damage article here on Guru. I did mine from the GuildWiki article. I find that I have a one point error against AL100 and the 2 point error you have against AL60 with Spear of Lightning. The equations work fine for Vicious Attack and Slayer's Spear. The error occurs on non-critical hits as well. I've seen up to 77 damage against AL60.

I don't have a sundering spear handy to check if the armor penetration equation is wrong or if this is a peculiarity of Spear of Lightning.
lorinton is offline   Reply With Quote
Old Mar 09, 2007, 11:10 AM // 11:10   #7
Academy Page
 
Join Date: Oct 2006
Default

Quote:
Originally Posted by lorinton
Looks like you based your calculations on Ensign's damage article here on Guru. I did mine from the GuildWiki article. I find that I have a one point error against AL100 and the 2 point error you have against AL60 with Spear of Lightning. The equations work fine for Vicious Attack and Slayer's Spear. The error occurs on non-critical hits as well. I've seen up to 77 damage against AL60.

I don't have a sundering spear handy to check if the armor penetration equation is wrong or if this is a peculiarity of Spear of Lightning.
Yeah the calculations are all based on Ensigns's article.

I've done considerably more testing and I may finally have something. First of all, the error isn't solely an issue with Spear of Lightning, I managed to replicate it with regular axe based attacks as well and discovered that it only occurs on odd multiples of 5% armour penetration e.g. 5%, 15%, 25%, 35%, 45%.

I'm not entierly sure yet where the error is coming from in my calculations, but at least I have something to go on rather than wondering if there's some oddity with Spear of Lightning.
TLLOTS is offline   Reply With Quote
Old Mar 09, 2007, 11:42 AM // 11:42   #8
Pre-Searing Cadet
 
Join Date: Feb 2006
Guild: TTT
Profession: E/Me
Default

My two cents from programming point of view is that your code rounds fractions different way than Guildwars does. This would explain 1 or 2 dmg point oddities.
Divine Fragrance is offline   Reply With Quote
Reply


Share This Forum!  
 
Thread Tools
Display Modes


All times are GMT. The time now is 08:55 AM // 08:55.